A hardware multi-pass attribute grammar evaluator
نویسندگان
چکیده
Attribute grammars (AGs) were introduced by Knuth in 1968. The addition of attributes and semantic rules to Context Free Grammars (CFG), augmented their expressional capabilities, making them, by this way, a really useful tool for a considerable number of applications. However, the additional complexity imposed by the added characteristics, dictates the need for hardware solutions for the whole procedure (parsing and attribute evaluation), as an attractive alternative to classical software solutions in order to speed-up the execution time. In this paper, a hardware architecture for a multi-pass attribute evaluation system is presented. The proposed system is based on an efficient combinatorial implementation of Earleys parallel parsing algorithm for the syntax part of the attribute grammar. The semantic part is managed by a special purpose module that traverses the parse tree as many times as needed, in order to evaluate the attributes. The entire system is described in Verilog HDL (Hardware Design Language), simulated for validation, synthesized and tested on a Xilinx FPGA (Field Programmable Gate Arrays) board for various AGs. Our method increases the performance up to three orders of magnitude compared to previous approaches.
منابع مشابه
Optimal Incremental Simple Multi-Pass Attribute Evaluation
Compiler optimizations can be described by tree transformations that replace complicated and non-efficient tree structures by equivalent but simpler and more efficient tree structures. For the specification of such tree transformations the classical attribute grammar framework has to be extended with conditional tree transformation rules, where predicates on attribute values (carrying context i...
متن کاملIncremental Attribute Evaluation of LR - attributedgrammars Using Space - E cient Data
Incremental attribute evaluation of one-pass attribute grammars (AGs) has not yet been fully investigated. However, considering the lightness of one-pass AGs, combining incremental evaluation and parsing in one-pass AGs may bring about a time-and space-eecient language processor. In this paper, an incremental attribute evaluation method based on LR-attributed grammar, a class of one-pass attrib...
متن کاملA Compiler Generator for Attributive Evaluation During LR Parsing
A compiler generator called Metauncle is introduced. Metauncle produces one-pass compilers in which all attributes are evaluated in conjunction with LR parsing. The description of a language is given to Metauncle as an L-attributed grammar, and the system transforms it before generation of an evaluator to another attribute grammar satisfying the requirements for evaluation. The transformed gram...
متن کاملConditional Evaluation in Simple Multi-Visit Attribute-Grammar Evaluators
Attribute grammars are a formalism for specifying computations on context-free languages. Due to the nonstrictness of the if constructs in attribution equations, it is possible to avoid evaluating certain attribute instances in a syntax tree. A dynamic evaluator can easily avoid such useless computations with a demand-driven approach. However, dynamic evaluators are not efficient because they n...
متن کاملPasses and Paths of Attributive Grammars
An attribute grammar is pure (left-to-right) multi-pass if a bounded number of left-to-right passes over the derivation tree suffice to compute all its attributes. There is no requirement, as for the usual multi-pass attribute grammars, that all occurrences of the same attribute are computed in the same pass, R is shown that the problem of determining whether an arbitrary attribute grammar is p...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
دوره شماره
صفحات -
تاریخ انتشار 2009